﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using ESOL.Common.Entity;
using ESOL.Common.DTO;

namespace ESOL.Services
{
    [ServiceContract]
    public interface IQcService
    {
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool TestConnect();

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<QcItemEntity> GetQcItemAllList(bool isActive);

        //Item质检项目
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcItemQueryPageResult GetQcMaintainItemAllListByCondition(QcItemQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveQcItem(QcItemSaveParam param);


        //Config配置
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcConfigEntity GetQcMaintainConfigByKey(string configId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcConfigEntity GetQcMaintainConfigByConfig(QcConfigEntity config);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcConfig(QcConfigEntity config);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcConfig(QcConfigEntity config);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcConfig(QcConfigEntity config);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        ConfigQueryPageResult GetQcConfigAllListByCondition(ConfigQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveQcConfig(QcConfigEntity config, string userNo);

        //Solution质检方案
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcSolutionEntity GetQcMaintainSolutionByKey(string solutionId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcSolutionEntity GetQcMaintainSolutionBySolution(QcSolutionEntity solution);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcSolution(QcSolutionEntity solution);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcSolution(QcSolutionEntity solution);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcSolution(QcSolutionEntity solution);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SolutionQueryPageResult GetQcSolutionAllListByCondition(SolutionQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveSolution(QcSolutionEntity solution, List<QcSolutionItemEntity> items, string userNo);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<QcSolutionItemEntity> GetQcSolutionItemAllListBySolutionId(string solutionId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<QcSolutionItemEntity> GetQcSolutionItemAllListBySolutionNo(string solutionNo);


        //抽样标准
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcSampleStdEntity GetQcMaintainSampleStdByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcSampleStd(QcSampleStdEntity std);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcSampleStd(QcSampleStdEntity std);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcSampleStd(QcSampleStdEntity std);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        StdQueryPageResult GetQcSampleStdAllListByCondition(StdQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveQcSampleStd(QcSampleStdEntity std, string userNo);

        //Iqc
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcIqcEntity GetQcIqcByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcIqc(QcIqcEntity iqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcIqc(QcIqcEntity iqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcIqc(QcIqcEntity iqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        IqcQueryPageResult GetQcIqcAllListByCondition(IqcQueryCondition con);


        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcIqcRecord(QcIqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcIqcRecord(QcIqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcIqcRecord(QcIqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<QcIqcRecordEntity> GetQcIqcRecordAllListByIqcNo(string IqcNo);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveQcIqc(IqcSaveParam param);

        //Spqc
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcSpqcEntity GetQcSpqcByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcSpqc(QcSpqcEntity spqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcSpqc(QcSpqcEntity spqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcSpqc(QcSpqcEntity spqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SpqcQueryPageResult GetQcSpqcAllListByCondition(SpqcQueryCondition con);


        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcSpqcRecord(QcSpqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcSpqcRecord(QcSpqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcSpqcRecord(QcSpqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<QcSpqcRecordEntity> GetQcSpqcRecordAllListBySpqcNo(string SpqcNo);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveQcSpqc(SpqcSaveParam param);

        //IPQC，过程检验
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcIpqcEntity GetQcIpqcByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcIpqc(QcIpqcEntity ipqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcIpqc(QcIpqcEntity ipqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcIpqc(QcIpqcEntity ipqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        IpqcQueryPageResult GetQcIpqcAllListByCondition(IpqcQueryCondition con);


        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcIpqcRecord(QcIpqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcIpqcRecord(QcIpqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcIpqcRecord(QcIpqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<QcIpqcRecordEntity> GetQcIpqcRecordAllListByIpqcNo(string IpqcNo);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveQcIpqc(IpqcSaveParam param);

        //IQC,工作流：到货，质检完成创建入库申请单
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        InvIappEntity QcIqcToInvIapp(string userNo, QcIqcEntity iqc);


        //PQC，成品检验
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        QcPqcEntity GetQcPqcByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcPqc(QcPqcEntity pqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcPqc(QcPqcEntity pqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcPqc(QcPqcEntity pqc);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        PqcQueryPageResult GetQcPqcAllListByCondition(PqcQueryCondition con);


        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddQcPqcRecord(QcPqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateQcPqcRecord(QcPqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DeleteQcPqcRecord(QcPqcRecordEntity e);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<QcPqcRecordEntity> GetQcPqcRecordAllListByPqcNo(string PqcNo);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveQcPqc(PqcSaveParam param);


    }
}
